//import A from "../pages/A";
// 路由懒加载的方式将组件引入
import {lazy} from "react"
import {Navigate} from "react-router-dom"
const My = lazy(()=>import("../views/My"))
const Detail = lazy(()=>import("../views/Detail"))
const Login = lazy(()=>import("../views/Login"))
const Canima = lazy(()=>import("../views/Index/Cnima"))
const Video = lazy(()=>import("../views/Index/Video"))
const ShotVideo = lazy(()=>import("../views/Index/ShortVideo"))
const Show = lazy(()=>import("../views/Index/Show"))
const Home = lazy(()=>import("../views/Index/Home"))

const routerconfig = [
   {
       path:"/my",
       element:<My></My>
   },
   {
        path:"/detail",
        element:<Detail></Detail>
   },
   {
       path:"/login",
       element:<Login></Login>
   },
   {
       path:"/home",
       element:<Home></Home>,
       children:[
           {
               path:"/home/canima",
               element:<Canima></Canima>
           },
           {
               path:"/home/video",
               element:<Video></Video>
           },
           {
               path:"/home/ShotVideo",
               element:<ShotVideo></ShotVideo>
           },
           {
               path:"/home/show",
               element:<Show></Show>
           },
           {
               path:"/home",
               element:<Navigate to="/home/canima"></Navigate>
           }
       ]
   },
   {
       path:"/",
       element:<Navigate to="/home"></Navigate>
   }
]
export default routerconfig